﻿namespace _5._10._1.School
{
    using System;

    public static class School
    {
        private static int nextFreeStudentNumber = 10000;

        public static int NextFreeStudentNumber
        {
            get
            {
                if (nextFreeStudentNumber < 10000 || nextFreeStudentNumber > 99999)
                {
                    throw new ArgumentOutOfRangeException();
                }

                return nextFreeStudentNumber;
                
                NextFreeStudentNumber++;
            }

            private set
            {
                nextFreeStudentNumber = value;
            }
        }
    }
}